#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
#include<string.h>

void* my_memcpy(void * dst, void * src, size_t n)
{
	void* ret = dst;
	assert(dst);
	assert(src);
	/*
	* copy from lower addresses to higher addresses
	*/
	while (n--) {
		*(char*)dst = *(char*)src;
		dst = (char*)dst + 1;
		src = (char*)src + 1;
	}
	return(ret);
}

int main()
{
	int ch1[10] = { 1,2,3,4,5,6,7,8,9,10 };
	int ch2[10] = { 0 };
	my_memcpy(ch2, ch1, 20);
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", ch2[i]);
	}
	return 0;
}